#ifndef PARAMETER_HPP
#define PARAMETER_HPP

#include <QtMath>
struct Parameter{
    int xNums,yNums,stop;
    double t0,tw,a,dt,dx,dy,l1,l2,rx,ry;
    Parameter() = default;
    Parameter(double t0,double tw,double a,
              double dt,double l1,double dx,int stop){
        init(t0,tw,a,dt,l1,dx,stop);
    }
    Parameter(double t0,double tw,double a,double dt,
              double l1,double l2,double dx,double dy, int stop){
        init(t0,tw,a,dt,l1,l2,dx,dy,stop);
    }
    inline void init(double t0,double tw,double a,
                     double dt,double l1,double dx, int stop){
        init(t0,tw,a,dt,l1,l1,dx,dx,stop);
    }
    inline void init(double t0,double tw,double a,double dt,
                     double l1,double l2,double dx,double dy,int stop){
        this->t0 = t0;
        this->tw = tw;
        this->a = a;
        this->dt = dt;
        this->l1 = l1;
        this->l2 = l2;
        this->dx = dx;
        this->dy = dy;
        this->stop = stop;
        this->rx = (a*dt)/(dx*dx);
        this->ry = (a*dt)/(dy*dy);
        this->xNums = qRound(l1/dx)+1;
        this->yNums = qRound(l2/dx)+1;
    }
};


#endif // PARAMETER_HPP
